Skip to content

refactor(bugfix): remove manual skill-loading boilerplate#107

Merged
jwm4 merged 2 commits intoambient-code:mainfrom
jwm4:refactor/bugfix-skill-invocation-cleanup
Apr 19, 2026
Merged

refactor(bugfix): remove manual skill-loading boilerplate#107
jwm4 merged 2 commits intoambient-code:mainfrom
jwm4:refactor/bugfix-skill-invocation-cleanup

Conversation

@jwm4
Copy link
Copy Markdown
Contributor

@jwm4 jwm4 commented Apr 14, 2026

Summary

  • Remove manual skill-loading boilerplate from all 13 bugfix workflow files
  • Replace file paths (.claude/skills/*/SKILL.md) with skill names (the assess skill) so the agent uses the platform's native skill invocation instead of the Read tool
  • Remove dispatch blocks from phase skills and return-and-re-read instructions that were workarounds for a now-fixed platform bug

Context

The bugfix workflow was engineered around a platform bug where the skill tool wasn't working. Skills were loaded via the Read tool with explicit file paths, and every phase skill had dispatch/return blocks telling the agent which file to re-read after completion. Now that the skill tool works, this scaffolding is unnecessary — it encourages the agent to bypass native skill invocation and makes the workflow non-portable across different runners.

ADR: docs/adr/2026-04-14-skill-invocation-cleanup.md

What changed

File(s) Change
ambient.json "read .claude/skills/controller/SKILL.md" → "run the controller skill"
CLAUDE.md File paths → skill names
controller/SKILL.md Skill names in phase list; removed Read tool instructions; removed "Always read skill files" rule
speedrun/SKILL.md Skill names in phase table; simplified execute/loop instructions
7 phase skills Removed dispatch blocks; removed return-and-re-read from completion
pr/SKILL.md Removed "return to coordinating skill and re-read"
summary/SKILL.md Simplified dispatch section; removed conditional return-and-re-read

What did NOT change

  • Phase logic (how to diagnose, test, review, etc.)
  • Gating rules (AskUserQuestion between phases)
  • Artifact paths
  • Recommendation logic
  • Escalation rules

Test plan

  • Validate JSON: ambient.json parses correctly
  • Skill resolution: agent can find and invoke each skill by name in ACP
  • Full controller flow: run assess → fix → test → review → PR with phase transitions
  • Speedrun flow: run full speedrun confirming progression through all phases
  • Direct skill invocation: invoke a phase skill directly (e.g., /diagnose)

Custom Workflow fields for testing

Field Value
URL https://github.com/jwm4/workflows.git
Branch refactor/bugfix-skill-invocation-cleanup
Path workflows/bugfix

Made with Cursor

The bugfix workflow was engineered around a platform bug where the
skill tool wasn't working. Skills were loaded via the Read tool with
explicit file paths, and every phase skill had dispatch/return blocks
telling the agent which file to re-read after completion. Now that
the skill tool works, this scaffolding is unnecessary and actively
harmful — it encourages the agent to bypass the platform's native
skill invocation.

Changes across 13 files in workflows/bugfix/:
- Replace file paths with skill names in controller and speedrun
- Remove "How to Execute" Read tool instructions from orchestrators
- Remove dispatch blocks from all 7 phase skills
- Remove return-and-re-read instructions from all phase skills
- Remove "Always read skill files" rule from controller
- Update ambient.json systemPrompt and CLAUDE.md to use skill names

The actual phase logic, gating rules, artifact paths, and
recommendation logic are all unchanged.

ADR: docs/adr/2026-04-14-skill-invocation-cleanup.md
Made-with: Cursor
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 14, 2026

Walkthrough

The pull request adds an ADR and updates the bugfix workflow docs to remove manual skill-loading boilerplate: phase skills drop dispatch/re-read instructions; controller and speedrun now reference and run phases by skill name; system prompt and workflow docs updated accordingly.

Changes

Cohort / File(s) Summary
ADR Documentation
docs/adr/2026-04-14-skill-invocation-cleanup.md
Add ADR describing removal of manual skill-loading boilerplate, proposed skill invocation model, affected files, risks, and testing plan.
System Configuration
workflows/bugfix/.ambient/ambient.json
Replace guidance to read the controller SKILL.md with instruction to run the controller skill in systemPrompt.
Phase Skills Dispatch Cleanup
workflows/bugfix/.claude/skills/assess/SKILL.md, workflows/bugfix/.claude/skills/diagnose/SKILL.md, workflows/bugfix/.claude/skills/document/SKILL.md, workflows/bugfix/.claude/skills/fix/SKILL.md, workflows/bugfix/.claude/skills/reproduce/SKILL.md, workflows/bugfix/.claude/skills/review/SKILL.md, workflows/bugfix/.claude/skills/test/SKILL.md
Remove "Dispatch" sections and end-of-phase re-read/return instructions; preserve phase logic, outputs, and reporting checklists.
Orchestration Skills
workflows/bugfix/.claude/skills/controller/SKILL.md, workflows/bugfix/.claude/skills/speedrun/SKILL.md
Change phase references from file paths to skill names (e.g., assess, fix); remove mandatory Read-tool calls and re-read requirements; speedrun now loops through named phases without per-phase re-reads; add rule to always recommend /review before /pr.
Phase Skill Minor Cleanup
workflows/bugfix/.claude/skills/summary/SKILL.md, workflows/bugfix/.claude/skills/pr/SKILL.md
Remove dispatch/re-read instructions while keeping summarization and PR creation content intact.
Workflow Documentation
workflows/bugfix/CLAUDE.md
Remove explicit .claude/skills/.../SKILL.md path examples; describe phases generically as named skills and retain artifact destination details.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing manual skill-loading boilerplate from the bugfix workflow.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the context, specific changes, what was unchanged, and a test plan.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jwm4 jwm4 marked this pull request as ready for review April 14, 2026 15:45
@jwm4
Copy link
Copy Markdown
Contributor Author

jwm4 commented Apr 15, 2026

@coderabbitai

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

@jwm4 Sure! I'll review the changes in this PR now.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

In testing, the agent skipped /review and recommended /pr directly
after /test, rationalizing that the fix was simple. Add targeted
guidance: always recommend /review before /pr — the agent implemented
the fix and is not in a position to objectively evaluate its quality.
Only the user can decide to skip review.

Made-with: Cursor
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@workflows/bugfix/.claude/skills/controller/SKILL.md`:
- Around line 37-39: The sentence fragment "Can also be invoked at any point
mid-workflow." in the description of the `summary` skill (/summary) should be
rewritten as a full sentence with an explicit subject; update it to something
like "The summary skill can also be invoked at any point mid-workflow." so it
clearly references the `summary` skill and reads as a complete sentence.
- Around line 94-99: The SKILL.md contains a policy conflict: the section that
mandates recommending `/review` before `/pr` (lines around the “Always recommend
`/review` before `/pr`” paragraph) conflicts with a later option that still
presents `/pr` as a direct alternative; update the document so messaging is
consistent by removing or rewording any suggestion that allows skipping review
and instead present `/pr` only as a follow-up action after `/review` completes,
and adjust the alternative list and examples that reference `/pr` (search for
occurrences of `/review` and `/pr` in the SKILL.md block and the paragraph
around lines 94–109) so every path requires `/review` first.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f1e318c2-14d6-45f3-a5ab-26e8dfa295c9

📥 Commits

Reviewing files that changed from the base of the PR and between 2e962af and fed38ba.

📒 Files selected for processing (1)
  • workflows/bugfix/.claude/skills/controller/SKILL.md

Comment on lines +37 to 39
9. **Summary** (`/summary`) — the `summary` skill
Scan all artifacts and present a synthesized summary of findings, decisions,
and status. Can also be invoked at any point mid-workflow.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Line 39 is a sentence fragment; make it a full sentence.

“Can also be invoked at any point mid-workflow.” should include an explicit subject for clarity.

🧰 Tools
🪛 LanguageTool

[style] ~39-~39: To form a complete sentence, be sure to include a subject.
Context: ... of findings, decisions, and status. Can also be invoked at any point mid-workfl...

(MISSING_IT_THERE)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@workflows/bugfix/.claude/skills/controller/SKILL.md` around lines 37 - 39,
The sentence fragment "Can also be invoked at any point mid-workflow." in the
description of the `summary` skill (/summary) should be rewritten as a full
sentence with an explicit subject; update it to something like "The summary
skill can also be invoked at any point mid-workflow." so it clearly references
the `summary` skill and reads as a complete sentence.

Comment on lines +94 to +99
**Always recommend `/review` before `/pr`.** Do not recommend skipping review, even for
fixes that seem simple or mechanical. You implemented the fix and wrote the
tests — you are not in a position to objectively evaluate their quality.
Review exists precisely to catch what the fixer misses. Only the user can
decide to skip it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Policy conflict: /review is mandatory before /pr, but options still suggest direct /pr.

Line 94-99 forbids recommending skip-review, but Line 109 still offers /pr as an alternative without requiring completed review. This contradiction will produce inconsistent controller behavior.

Suggested patch
@@
 Recommended next step: /test — verify the fix with regression tests.
 
 Other options:
 - /review — critically evaluate the fix before testing
-- /pr — if you've already tested manually and want to submit
+- /document — if testing is complete and you want to prepare release notes before review
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@workflows/bugfix/.claude/skills/controller/SKILL.md` around lines 94 - 99,
The SKILL.md contains a policy conflict: the section that mandates recommending
`/review` before `/pr` (lines around the “Always recommend `/review` before
`/pr`” paragraph) conflicts with a later option that still presents `/pr` as a
direct alternative; update the document so messaging is consistent by removing
or rewording any suggestion that allows skipping review and instead present
`/pr` only as a follow-up action after `/review` completes, and adjust the
alternative list and examples that reference `/pr` (search for occurrences of
`/review` and `/pr` in the SKILL.md block and the paragraph around lines 94–109)
so every path requires `/review` first.

@jwm4 jwm4 merged commit 65b811e into ambient-code:main Apr 19, 2026
2 checks passed
@jwm4 jwm4 deleted the refactor/bugfix-skill-invocation-cleanup branch April 19, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant